﻿using Abp.Application.Services.Dto;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Camc.Quality.Bom.Dto
{
    /// <summary>
    /// bom明细
    /// </summary>
    public class BomEditList
    {
        public BomEditParentData data { get; set; }
        public List<BomDetaillist> children { get; set; } = new List<BomDetaillist>();
    }
    public class BomEditParentData : EntityDto<Guid>
    {
        /// <summary>
        /// 物料详细信息ID
        /// </summary>
        public Guid MaterialsContentId { get; set; }
        /// <summary>
        /// bom类型
        /// </summary>
        public string BomType { get; set; }
        /// <summary>
        /// 版本
        /// </summary>
        public string VersionNo { get; set; }
        /// <summary>
        /// 规格型号（前端需要名字统一）
        /// </summary>
        public string Model { get; set; }
        /// <summary>
        /// 规格型号id
        /// </summary>
        public Guid? ModelId { get; set; }
        /// <summary>
        /// 是否使用
        /// </summary>
        public int IsUsed { get; set; }
        /// <summary>
        /// 变更ID
        /// </summary>
        public Guid ChangeId { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 标识(保存和保存并送审要用到)
        /// </summary>
        public int Bs { get; set; }
        /// <summary>
        /// 标识(新增时用到)
        /// </summary>
        public int InsertBs { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// 物料类别名称
        /// </summary>
        public string MaterialTypeName { get; set; }
        /// <summary>
        /// 物料代码
        /// </summary>
        public string MaterialNo { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        ///物料属性
        /// </summary>
        public string MaterialPropertyName { get; set; }
        /// <summary>
        ///创建人
        /// </summary>
        public string CreateUserName { get; set; }
        /// <summary>
        /// 用于排序
        /// </summary>
        public int OrderNum { get; set; }
        /// <summary>
        /// 发次
        /// </summary>
        public string SendTime { get; set; }
        /// <summary>
        /// 发次
        /// </summary>
        public Guid? SendTimeId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 部套id
        /// </summary>
        public Guid? Btid { get; set; }
        /// <summary>
        /// 年代号
        /// </summary>
        public string YearsNo { get; set; }
    }
    public class BomEditChildData : EntityDto<Guid>
    {
        /// <summary>
        /// bom主表id
        /// </summary>
        public Guid BomDesignId { get; set; }
        /// <summary>
        /// 物料id
        /// </summary>
        public Guid MaterialId { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// 物料图号
        /// </summary>
        public string MaterialNo { get; set; }
        /// <summary>
        /// 物料代码
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// 规格型号（前端需要名字统一）
        /// </summary>
        public string Model { get; set; }
        /// <summary>
        /// 单位（前端需要名字统一）
        /// </summary>
        public string UnitName { get; set; }
        /// <summary>
        /// 物料细分类别名称
        /// </summary>
        public string IsKeyPart { get; set; }
        /// <summary>
        /// 版本
        /// </summary>
        public string VersionNo { get; set; }
        /// <summary>
        /// 单位Id
        /// </summary>
        public string UnitId { get; set; }
        /// <summary>
        /// 父级物料id
        /// </summary>
        public Guid ParentMaterialId { get; set; }
        /// <summary>
        /// 父级id
        /// </summary>
        public Guid ParentId { get; set; }
        /// <summary>
        ///单位1BOM用量=单位净用量/(1-损耗率）
        /// </summary>
        public int Unit1BomDosage { get; set; }
        /// <summary>
        ///物料属性（前端需要名字统一）
        /// </summary>
        public int Attribute { get; set; }
        /// <summary>
        /// 物料类别名称
        /// </summary>
        public string MaterialTypeName { get; set; }
        /// <summary>
        /// 物料细分类别名称
        /// </summary>
        public string MaterialSegmentationName { get; set; }
        /// <summary>
        /// 层级关系
        /// </summary>
        public string LevelRelationship { get; set; }
        /// <summary>
        /// 层级
        /// </summary>
        public int LevelNum { get; set; } = 0;
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 前端递归用
        /// </summary>
        public int SonLevel { get; set; }
        /// <summary>
        /// 前端递归用
        /// </summary>
        public string SonId { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 状态（删除按钮用）
        /// </summary>
        public int DeleStatus { get; set; } = -2;
        /// <summary>
        ///物料属性
        /// </summary>
        public string MaterialPropertyName { get; set; }
        /// <summary>
        ///创建人
        /// </summary>
        public string CreateUserName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 用于排序
        /// </summary>
        public int OrderNum { get; set; }
        /// <summary>
        /// 部套id
        /// </summary>
        public Guid? Btid { get; set; }
        /// <summary>
        /// 组件内组件标志
        /// </summary>
        public int? WithinComponent { get; set; }

        /// <summary>
        /// 年代号
        /// </summary>
        public string YearsNo { get; set; } = "";

    }
    public class BomDetaillist
    {
        public BomEditChildData data { get; set; }
        public List<BomDetaillist> children { get; set; }
        /// <summary>
        /// 0成功 1 失败
        /// </summary>
        public int code { get; set; } = 0;

        public string Message { get; set; }
    }

    public class ResultJson
    {
        public bool IsJosn { get; set; } = true;
    }

}
